/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author Ivan Ivic
 */
public class PropsFile {
    private static PropsFile props;

    private String url, driver;
    private Properties kljucVrednost;

    public static PropsFile getProps(String filepath) throws FileNotFoundException, IOException {
        if (props == null)
            props = new PropsFile(filepath);
        return props;
    }

    private PropsFile(String filepath) throws FileNotFoundException, IOException
    {
        kljucVrednost = new Properties();
        FileInputStream fis = new FileInputStream(filepath);
        kljucVrednost.load(fis);

        url = kljucVrednost.getProperty("url");
        driver = kljucVrednost.getProperty("driver");

        fis.close();
    }

    public String getDriver() {
        return driver;
    }

    public String getUrl() {
        return url;
    }

    
}
